package provatable;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the CANZONI database table.
 * 
 */
@Entity
@NamedQuery(name="Canzoni.findAll", query="SELECT c FROM Canzoni c")
public class Canzoni implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private long oid;

	private double durata;

	private String titolo;

	private String url;

	//bi-directional many-to-one association to Album
	@OneToMany(mappedBy="canzoni")
	private List<Album> albums;

	//bi-directional many-to-one association to Scaletta
	@OneToMany(mappedBy="canzoni")
	private List<Scaletta> scalettas;

	public Canzoni() {
	}

	public long getOid() {
		return this.oid;
	}

	public void setOid(long oid) {
		this.oid = oid;
	}

	public double getDurata() {
		return this.durata;
	}

	public void setDurata(double durata) {
		this.durata = durata;
	}

	public String getTitolo() {
		return this.titolo;
	}

	public void setTitolo(String titolo) {
		this.titolo = titolo;
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<Album> getAlbums() {
		return this.albums;
	}

	public void setAlbums(List<Album> albums) {
		this.albums = albums;
	}

	public Album addAlbum(Album album) {
		getAlbums().add(album);
		album.setCanzoni(this);

		return album;
	}

	public Album removeAlbum(Album album) {
		getAlbums().remove(album);
		album.setCanzoni(null);

		return album;
	}

	public List<Scaletta> getScalettas() {
		return this.scalettas;
	}

	public void setScalettas(List<Scaletta> scalettas) {
		this.scalettas = scalettas;
	}

	public Scaletta addScaletta(Scaletta scaletta) {
		getScalettas().add(scaletta);
		scaletta.setCanzoni(this);

		return scaletta;
	}

	public Scaletta removeScaletta(Scaletta scaletta) {
		getScalettas().remove(scaletta);
		scaletta.setCanzoni(null);

		return scaletta;
	}

}